package com.zcx.qshop.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import android.widget.TextView;

import com.zcx.helper.bound.BoundView;
import com.zcx.helper.util.UtilApp;

import com.zcx.qshop.R;
import com.zcx.qshop.conn.Conn;
import com.zcx.qshop.entity.Good;
import com.zcx.qshop.view.TitleView;

/**
 * Created by Administrator on 2015/8/22 0022.
 */
public class AboutUsActivity extends QSActivity {

    @BoundView(R.id.title_view) private TitleView titleView;

    @BoundView(R.id.about_us_ver) private TextView ver;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_about_us);

        titleView.showStyle(TitleView.Style.FULL);

        titleView.showType(TitleView.Type.BACK_TWO, TitleView.Type.NAME_ONE);

        titleView.setTitleName("关于我们");

        titleView.setOnTitleItemClickListener(new TitleView.OnTitleItemClickListener() {

            @Override
            public void onBackClick() {

                finish();

            }

        });

        ver.setText("当前版本：V" + UtilApp.versionName(this));

    }

    public void onYCWeiBo(View view){

        start("微博", "http://www.baidu.com");

    }

    public void onCompanyIntroduction(View view){

        start("公司简介", Conn.SERVICE_URL + Conn.INLET_JSON_ABOUT);

    }

    public void onUserAgreement(View view){

        start("用户协议", Conn.SERVICE_URL + Conn.INLET_JSON_REGISTINFO);

    }

    public void onAppBazaar(View view){

        startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.zcx.yc")));

    }

    private void start(String title, String url){

        Good good = new Good();

        good.title = title;

        good.pid = url;

        startVerifyActivity(WebActivity.class, new Intent().putExtra("Good", good));

    }

}
